/*
 * client.h
 *
 *  Created on: 11 mei 2013
 *      Author: Pascal
 */

#ifndef CLIENT_H_
#define CLIENT_H_

#include <winsock2.h>
#include <ws2tcpip.h>
#include <iphlpapi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sensors.h"
#include "json.h"
#include "communication.h"
#include <ctype.h>
#include "circular_buffer.h"

// Not sure if this is large enough. It probably is.
#define RECEIVE_BUFFER_SIZE 1000

// A rough estimate of the buffer size needed to transmit a JSON object containing all sensors.
#define SEND_BUFFER_SIZE ((SENSORS_TOTAL_AMOUNT*250)+100)
#define CIRCULAR_BUFFER_SIZE 100

// Maximum amount of simultaneous clients
#define MAX_CLIENT_AMOUNT 20

int initNewClient(SOCKET);
void putInSendBuffers(char[], int);
void initClientSlots();
int isValidReceiveChar(char);

DWORD WINAPI CommThread(void*);

#endif /* CLIENT_H_ */
